google.load('visualization', '1', {'packages':['annotatedtimeline']});
google.setOnLoadCallback(drawChart);
function drawChart() {
  var data = new google.visualization.DataTable();
  var columns = getColumns();
  var rows = getRows();

  for (var i in columns)
  {
    var column = columns[i];
    data.addColumn(column[1], column[0]);
  }

  for (var i in rows)
  {
    var row = rows[i];
    data.addRow(row);
  }

  var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
  chart.draw(data, {displayAnnotations: true});
}

function getColumns()
{
  var col = [['aika', 'date'], ['number', 'number'], ['Anssi', 'number'], ['Toni', 'number']];
  return col;
}

function getRows()
{
  var rows = [
  [new Date(2011, 0, 20, 18, 0, 0, 0), 0.5, 1, 1.5],
  [new Date(2011, 0, 20, 18, 15, 0, 0), 0.7, 2, 1.5],
  [new Date(2011, 0, 20, 18, 30, 0, 0), 0.9, 1.5, 1.5],
  [new Date(2011, 0, 20, 18, 45, 0, 0), 1.3, 1.3, 1.5],
  [new Date(2011, 0, 20, 19, 0, 0, 0), 1.5, 1.1, 1.5],
  [new Date(2011, 0, 20, 19, 15, 0, 0), 1.7, 1.0, 1.5],
  [new Date(2011, 0, 20, 19, 30, 0, 0), 1.5, 1, 1.5],
  [new Date(2011, 0, 20, 19, 45, 0, 0), 1.4, 0.9, 1.5],
  ];

  return rows;
}


